#!/usr/bin/env python
from eas_prediction import PredictClient
from eas_prediction import StringRequest
if __name__ == '__main__':
    #下面的client = PredictClient()入参源于公网调用的访问地址。
    client = PredictClient('http://1733029716806217.cn-wulanchabu.pai-eas.aliyuncs.com/api/predict/server_eas_qwen_7b_chat','heart_predict_online')
    #Token可以在公网地址调用信息中获取，详情请参见通用公网调用部分。
    client.set_token('ZGE3MTI4NWNjN2UxOTkyYmJiN2ZiNzM5ZGU2YzMyMmQ2OTEwZDBkZQ==')
    client.init()
    #输入请求需要根据模型进行构造，此处仅以字符串作为输入输出的程序为例。
    request = StringRequest('[{"sex":0,"cp":0,"fbs":0,"restecg":0,"exang":0,"slop":0,"thal":0,"age":0,"trestbps":0,"chol":0,"thalach":0,"oldpeak":0,"ca":0}]')
    for x in range(0, 1):
        resp = client.predict(request)
        print(resp)